package o;

import android.app.Activity;
import android.app.ActivityManager;
import android.content.Context;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.appmarket.service.config.protocol.AppLaunchProtocol;
import com.huawei.appmarket.service.config.protocol.AppLaunchProtocol.Request;
import com.huawei.fastengine.fastview.download.utils.PackageUtils;
import o.cii.c;
import o.ewm.n;

public class edi {
    private static edi ˏ;

    public static class a implements c {
        public void ˏ(Context context, BaseCardBean baseCardBean) {
            if (context != null && (context instanceof Activity)) {
                edi.ˋ().ˎ((Activity) context);
            }
        }
    }

    private edi() {
    }

    public static edi ˋ() {
        if (ˏ == null) {
            ˏ = new edi();
        }
        return ˏ;
    }

    private void ˎ(Activity activity) {
        if (dgm.isGameVSupport()) {
            ced.ˎ(activity.getApplicationContext(), PackageUtils.HWGAMEBOX_PACKAGE_NAME, activity.getString(n.ˊᶥ));
        } else if (dgm.ˊ() != -1) {
            ((ActivityManager) activity.getSystemService("activity")).moveTaskToFront(dgm.ˊ(), 1);
            activity.overridePendingTransition(ewm$a.ˋ, ewm$a.ˏ);
        } else {
            cjo appLaunchProtocol = new AppLaunchProtocol();
            appLaunchProtocol.ˊ(new Request(true));
            cjm o_cjm = new cjm("gamebox.activity", appLaunchProtocol);
            o_cjm.ॱ(activity).addFlags(268468224);
            cjk.ˎ().ˋ(activity, o_cjm);
            activity.overridePendingTransition(ewm$a.ˋ, ewm$a.ˏ);
        }
    }
}
